package com.ruoyi.system.kysh.mapper;

import com.ruoyi.system.kysh.entity.TaskPlan;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

@Mapper
public interface TaskPlanMapper {

    List<TaskPlan> selectByTaskIdAndTaskName(@Param("ticketNum") String ticketNum,@Param("ticketName") String ticketName
            ,@Param("firstIndex") int firstIndex,@Param("pageSize") int pageSize);

    Long selectDeptIdByTaskId(Long id);

    Long selectBorerIdByTaskId(Long id);

    void deleteTaskPlanById(Long id);

    TaskPlan selectByIdNotSeeDel(Long id);

    String selectMachIdByTaskId(Long id);

    String selectBorerNumByMachId(String borerMachId);

    Long selectTaskIdByTicketNum(String ticketNum);

    void saveTaskPlanTable(TaskPlan taskPlan);

    void saveDeptIdBuTaskId(@Param("taskId") Long taskId,@Param("deptId") Long deptId);

    void saveDrillIdByTaskId(@Param("taskId") Long taskId,@Param("borerId") Long borerId);

    void saveBorerIdByTaskId(@Param("taskId") Long taskId,@Param("borerMachId") String borerMachId);

    void updateTaskPlanTable(TaskPlan taskPlan);

    void updateDeptIdBuTaskId(@Param("taskId") Long id,@Param("deptId") Long deptId);

    void updateDrillIdByTaskId(@Param("taskId") Long id,@Param("borerId") Long borerId);

    void updateBorerIdByTaskId(@Param("taskId") Long id,@Param("borerMachId") String borerMachId);

    TaskPlan selectByTaskId(Long id);

    void updateSailingsByTaskId(@Param("id") Long id, @Param("status") String sailings, @Param("updateTime")Date updateTime);

    List<Long> selectTaskIdByDeptId(Long deptId);

    void bindVideoByTaskId(@Param("taskId") Long taskId,@Param("videoLoc") String videoLoc);

    List<TaskPlan> selectDailyByTimeAndSailings(@Param("workTime") Date workTime,@Param("sailings") String sailings
            ,@Param("acceptNum") String acceptNum,@Param("firstIndex") int firstIndex,@Param("pageSize") int pageSize);

    List<Long> selectTaskIdByDate(Date date);

    List<String> selectWorkersByTaskId(Long taskId);

    void changeTaskStatus(@Param("taskId") Long taskId,@Param("status") String status);

    List<TaskPlan> selectByTaskIdAndTaskNameAll(@Param("ticketNum") String ticketNum,@Param("ticketName") String ticketName);

    List<TaskPlan> selectDailyByTimeAndSailingsAll(@Param("workTime") Date workTime,@Param("sailings") String sailings
            ,@Param("acceptNum") String acceptNum);
}
